﻿<UserControl x:Class="ThumbGen.FileSelectorControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="Bool2VisibConverter"/>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <TextBlock Text="{Binding Label}" VerticalAlignment="Center" Grid.Column="0"/>
        <TextBox Text="{Binding Filepath, Mode=TwoWay}" VerticalAlignment="Center" Margin="5 0 3 0" MinWidth="50" Grid.Column="1"/>
        <StackPanel Orientation="Horizontal" Grid.Column="2">
            <Button Content="..." Click="Button_Click" MinWidth="22" ToolTip="Select movie file"/>
            <Button Click="SelectFolder_Click" MinWidth="22" ToolTip="Select folder for which to generate sheet" Margin="2 0 0 0"
                    Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=AllowFolder, Converter={StaticResource Bool2VisibConverter}}">
                <Image Source="/images/folder.png" Width="16" Height="16"/>
            </Button>
        </StackPanel>
    </Grid>
</UserControl>
